package com.eorchis.module.trainingclass.service;

import java.util.List;
import java.util.Map;
import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.basedao.entity.impl.AbstractBaseEntity;
import com.eorchis.core.service.IBaseService;
import com.eorchis.module.classuser.domain.DepartmentUserBean;
import com.eorchis.module.department.domain.Department;
import com.eorchis.module.department.domain.DepartmentTreeCondition;
import com.eorchis.module.department.ui.commond.DepartmentValidCommond;
import com.eorchis.module.trainingclass.domain.BaseAttachment;
import com.eorchis.module.trainingclass.domain.BaseUserBean;
import com.eorchis.module.trainingclass.domain.SyncTrainingClassQueryBean;
import com.eorchis.module.trainingclass.domain.TrainingClass;
import com.eorchis.module.trainingclass.domain.TrainingClassPartFieldUpdateBean;
import com.eorchis.module.trainingclass.querybean.TrainingClassQueryBean;
import com.eorchis.module.trainingclass.ui.commond.TrainingClassQueryCommond;
import com.eorchis.module.trainingclass.ui.commond.TrainingClassValidCommond;
import com.eorchis.module.user.domain.User;

/**
 * Title: ITrainingClassService<br>
 * Description: 培训班信息管理业务接口<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * 
 * @author Max
 * @createDate 2013-12-10
 * @version $Revision$
 */
public interface ITrainingClassService extends IBaseService

{
	/**
	 * 根据查询条件获取专题班信息
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-11
	 */
	List<TrainingClassQueryBean> findThematicClassList(TrainingClassQueryCommond commond) throws Exception;
	
	/**
	 * 根据查询条件获取专题班信息
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-11
	 */
	List<TrainingClassQueryBean> findThematicClassList2(TrainingClassQueryCommond commond) throws Exception;

	/**
	 * 根据查询条件获取专题班信息
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-11
	 */
	List<TrainingClassQueryBean> findThematicClassListSignUp(TrainingClassQueryCommond commond) throws Exception;
	
	/**
	 * 根据查询条件获取专题班信息
	 * @param commond
	 * @return List<TrainingClassQueryBean>
	 * @throws Exception
	 * @author RongSL
	 * @date 2017-02-06
	 */
	List<TrainingClassQueryBean> findThematicClassListSignUp2(TrainingClassQueryCommond commond) throws Exception;

	/**
	 * 根据查询条件获取专题班信息
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Gaogq
	 * @date 2015-03-26
	 */
	List<TrainingClassQueryBean> findThematicClassListFinish(TrainingClassQueryCommond commond) throws Exception;

	/**
	 * 单位班根据查询条件获取专题班信息
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-23
	 */
	List<TrainingClassQueryBean> findTrainingClassListForUnitPorject(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 在添加和修改的时候判断培训班名称是否一样
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-17
	 */
	boolean decideClassName(TrainingClassValidCommond commond) throws Exception;

	/**
	 * 更新班级状态 启用/作废、 发布/未发布、（暂 不支持上报）
	 * 
	 * @param trainingClassPartFieldUpdateBean
	 * @throws Exception
	 * @author ZhaoQT
	 * @date 2013-12-17
	 */
	public void updateTrainingClassState(TrainingClassPartFieldUpdateBean trainingClassPartFieldUpdateBean) throws Exception;

	/**
	 * 班级信息值的传递
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-18
	 */
	TrainingClassValidCommond swapClassInfo(TrainingClassValidCommond vcommond) throws Exception;

	/**
	 * 更新培训班信息
	 * 
	 * @param commond
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-19
	 */
	String updateTraingClass(TrainingClassValidCommond commond) throws Exception;

	/**
	 * 更改专题班开班状态 （调度使用）
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-25
	 */
	String updateThematicClassOpenStateQuartz(TrainingClassQueryCommond commond) throws Exception;

	/**
	 * 根据查询条件获取专题班信息(区级项目报名列表)
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @date 2013-12-25
	 */
	List<TrainingClassQueryBean> findOrganizationTrainingClassList(TrainingClassQueryCommond commond) throws Exception;

	/**
	 * 查单位上报区级项目审核
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2013-12-30
	 */
	List<TrainingClassQueryBean> findTrainingClassListForAuditUnitPorject(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 查询单位上报市级项目审核
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author
	 * @date 2014-1-7
	 */
	public List<TrainingClassQueryBean> findTrainingClassListForAuditDS(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 向干教网同步数据查询培训项目列表
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author HuangTF
	 * @date 2014-1-9
	 */
	public List<SyncTrainingClassQueryBean> findTrainingClassListSyncToGJW(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 更新班级表项目审核时间
	 * 
	 * @throws Exception
	 * @author HuangTF
	 * @createDate 2014-1-17
	 */
	public void updateAduitDate(String classId, String aduitDate) throws Exception;

	/**
	 * 根据用户id查询用户部门id
	 * 
	 * @throws Exception
	 * @author NingSS
	 * @createDate 2014-4-12
	 */
	public String getDepIdByUserId(String userId) throws Exception;

	public List<DepartmentUserBean> getDepIdByUserIds(String[] userId) throws Exception;

	/**
	 * 导入干部库历史培训信息
	 * 
	 * @param resultState
	 * @return
	 * @throws Exception
	 * @author Max
	 * @date 2014-5-9
	 */
	String importHisTrainingInfo(byte[] bs) throws Exception;

	/**
	 * 导入干部库历史在线培训信息
	 * 
	 * @param resultState
	 * @return
	 * @throws Exception
	 * @author Max
	 * @throws Exception
	 * @date 2014-5-9
	 */
	String importHisOnLineTrainingInfo(byte[] bs) throws Exception;

	String getTrainingNum(TrainingClassValidCommond vCommond) throws Exception;

	boolean getCourseNum(TrainingClassQueryCommond queryCommond) throws Exception;

	void updateClassAuditState(TrainingClassQueryCommond qCommond) throws Exception;

	String updateClassForGW(TrainingClassValidCommond commond) throws Exception;

	void updateStudyHour(Double hour, String classId) throws Exception;

	/**
	 * 查询班级列表(不分页)
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author Xupp
	 * @date 2014-12-16
	 */
	List<TrainingClassQueryBean> findThematicClassListNoPage(TrainingClassQueryCommond commond) throws Exception;

	boolean getStudentNum(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 单位报名班级列表
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @date 2015-1-5
	 */
	public List<TrainingClassQueryBean> findTrainingClassListByDept(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 单位报名班级列表
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author GaoGQ
	 * @date 2015-1-5
	 */
	public List<TrainingClassQueryBean> findTrainingClassListByDeptFinish(TrainingClassQueryCommond queryCommond) throws Exception;

	void updateCState(String classId) throws Exception;

	/**
	 * 个人可报名班级列表
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author ShenPS
	 * @date 2015年1月11日
	 */
	public List<TrainingClassQueryBean> findUserSignupClassList(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 查询单位培训班没有分页
	 * 
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author ShenPS
	 * @date 2015年1月15日
	 */
	public List<TrainingClassQueryBean> findTrainingClassListByDeptNoPage(TrainingClassQueryCommond queryCommond) throws Exception;

	List<TrainingClassQueryBean> queryTrainingClassList(TrainingClassQueryCommond qCommond) throws Exception;

	/**
	 * 判断培训班编号是否一样
	 * 
	 * @param commond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @date 2016-1-15
	 */
	boolean decideClassNum(TrainingClassValidCommond commond) throws Exception;

	/**
	 * @category 查询班级的报名情况(委托部委办班在线报名系统)
	 * @param validCommond
	 * @throws Exception
	 * @author NingSS
	 * @return
	 */
	List<TrainingClassQueryBean> findClassUserAsignCount(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * @评估查询
	 * @Name: findClassAssessmentt
	 * @Description: @param qCommond
	 * @Description: @param request
	 * @Description: @param response
	 * @Description: @param resultState
	 * @Description: @return
	 * @Description: @throws Exception
	 * @Author: GUOLEI
	 * @Version: V1.00
	 * @Create Date: 2016-2-6下午12:23:22
	 * @Parameters: ITrainingClassService
	 * @Return: String
	 */
	public List<TrainingClassQueryBean> findClassAssessmentt(TrainingClassQueryCommond qCommond) throws Exception;

	/**
	 * @评估人员
	 * @Name: findAnswerUser
	 * @Description: @param queryCommond
	 * @Description: @throws Exception
	 * @Author: RongSL
	 * @Version: V1.00
	 * @Create Date: 2016-2-16
	 * @Return: List<BaseUser>
	 */

	public List<BaseUserBean> findAnswerUser(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 查询已评估人员
	 * @createDate 2017-3-2
	 * @author RongSL
	 * */
	List<BaseUserBean> findAlreadyEvaluated(TrainingClassQueryCommond queryCommond) throws Exception ;
	/**
	 * 更新评估时间
	 * 
	 * @param commond
	 * @throws Exception
	 * @author LongJZ
	 * @date 2016-4-18
	 */
	public void updateAssessTime(TrainingClassValidCommond commond) throws Exception;

	/**
	 * 新增附件
	 * 
	 * @param commond
	 * @throws Exception
	 * @author RongSL
	 * @date 2016-7-28
	 */
	public BaseAttachment saveBaseAttachment(BaseAttachment bd);

	/**
	 * 获得培训班考勤率
	 * 
	 * @author RongSL
	 * @Date 2016-09-17
	 * */
	public Map<String, Integer> getAttendanceChance(TrainingClassQueryCommond queryCommond);

	/**
	 * @课程评估查询
	 * @Name: findClassAssessmentt
	 * @Author: RongSL
	 * @CreateDate: 2016-5-20
	 * @Return: List<TrainingClassQueryBean>
	 */
	public List<TrainingClassQueryBean> findCourseAssessment(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * @课程评估人员
	 * @Name: findCourseAnswerUser
	 * @Description: @param queryCommond
	 * @Description: @throws Exception
	 * @Author: RongSL
	 * @Version: V1.00
	 * @Create Date: 2016-5-30
	 * @Return: List<BaseUser>
	 */
	public List<BaseUserBean> findCourseAnswerUser(TrainingClassQueryCommond queryCommond) throws Exception;

	/**
	 * 查询子部门
	 * */
	  public List<Department> findDedepartmentList(DepartmentValidCommond commond)  throws Exception;
	  

		/**
		 * 获得培训班编号
		 * @author RongSL
		 * @date 2017-01-07
		 * */
		public String getTrainingClassNum();
		
		/**
		 * 保存实体bean
		 * @author RongSL
		 * @date 2017-01-08
		 * */
		public <T extends AbstractBaseEntity & IBaseEntity> void saveEntity(T view);
		
		/**
		 * 通过登陆ID查询用户数据
		 * */  
		public User findByLoginID(String loginID);

		public String saveClassUser(TrainingClass tc, User user);
		
		/**
		 * 通过ClassId查找
		 * @param classId
		 * @return
		 */
		public TrainingClass findByClassId(String classId);
		/**
		 * 查询是否有该班级的报名权限
		 * @param deptId
		 * @param classNum
		 * @return
		 */
		public int findRoleForScope(String deptId, String classNum);
		
		/**
		 * 查询是否有被市委组织部选为承办部委
		 * @author RongSL
		 * @Date 2017-01-19
		 * */
		public int isGJCChoiceUndertake(String depId);

		/**
		 * 批量更新问卷评估方式
		 * @author RongSl
		 * @Date 2017-02-13
		 * */
		public void updateQuestionnaireMethod(TrainingClassQueryCommond queryCommond);
		
		//查询二级节点上的第一个一级节点 by RongSL 20170705
		public List<?> findAdminLevel(DepartmentTreeCondition condition) throws Exception;
		
		public List<TrainingClassQueryBean> findAuditTrainingClassList(TrainingClassQueryCommond commond) throws Exception;
		
		/**
		 * 查询培训班(归档数据)
		 * @author RongSL
		 * 2017年12月22日
		 * */
		public TrainingClassValidCommond findTrainingPxarchives(TrainingClassValidCommond vCommond);
}
